package com.ruoyi.game.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.common.utils.UserContext;
import com.ruoyi.game.domain.bo.Pick3ReqBO;
import com.ruoyi.game.domain.bo.WingoReqBO;
import com.ruoyi.game.domain.entity.UserPick3Record;
import com.ruoyi.game.service.IUserPick3RecordService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 用户pick3投注信息Controller
 * 
 * @author ruoyi
 * @date 2024-05-13
 */
@RestController
@RequestMapping("/app/game/user/pick3")
public class UserPick3RecordController extends BaseController
{
    @Autowired
    private IUserPick3RecordService userPick3RecordService;

    /**
     * 去pick3投注
     * @param pick3ReqBO
     * @return
     */
    @PostMapping("/go")
    public AjaxResult go(@RequestBody @Validated Pick3ReqBO pick3ReqBO){
        return userPick3RecordService.go(pick3ReqBO);
    }

    /**
     * 查询用户pick3投注信息列表
     * @param pageNo
     * @param pageSize
     * @return
     */
    @GetMapping("page")
    public AjaxResult page(int pageNo,int pageSize,int timeLimit){
        return AjaxResult.success(userPick3RecordService.page(UserContext.getUserId(),pageNo,pageSize,timeLimit));
    }

    /**
     * 查询用户pick3投注信息列表
     * @param roundNo
     * @return
     */
    @GetMapping("findByRoundNo")
    public AjaxResult findByRoundNo(String roundNo){
        return AjaxResult.success(userPick3RecordService.findByRoundNo(UserContext.getUserId(),roundNo));
    }
}
